package com.fxkj.cloud.drms.infra.persistence.po;

import com.fxkj.cloud.drms.infra.persistence.constants.AlarmHistoryPOConstants;
import com.fxkj.common.constants.BaseSqlConstants;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import java.util.UUID;

/**
 * <p>description: </p>
 * @author ww
 * @date 2025/4/7 15:23
 */
@Entity
@Table(name = AlarmHistoryPOConstants.ALARM_HISTORY_TABLE_NAME)
@Getter
@Setter
@NoArgsConstructor
public class AlarmHistoryPO {

    @Id
    @Column(name = BaseSqlConstants.BASE_COL_ID, nullable = false)
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(
            name = "uuid",
            strategy = "org.hibernate.id.UUIDGenerator",
            parameters = {
                    @org.hibernate.annotations.Parameter(
                            name = "uuid_gen_strategy_class",
                            value = "org.hibernate.id.uuid.StandardRandomStrategy"
                    )
            }
    )
    private UUID id;

    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_DEVICE_SERIAL_NO)
    private String deviceSerialNo;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_DEVICE_NAME)
    private String deviceName;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_START_TS)
    private Long startTs;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_END_TS)
    private Long endTs;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_CLOSED)
    private Boolean closed;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ALARM_TEXT)
    private String alarmText;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ALARM_LEVEL)
    private Integer alarmLevel;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ALARM_CODE)
    private String alarmCode;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ALARM_VALUE)
    private String alarmValue;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_DEVICE_ID)
    private UUID deviceId;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_PRODUCT_ID)
    private UUID productId;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ORGANIZATION_ID)
    private UUID organizationId;
    @Column(name = AlarmHistoryPOConstants.ALARM_HISTORY_COL_ALARM_NAME)
    private String alarmName;
}
